/*
 * Copyright 2013 Andra.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package tuwien.big.formel0.twitter;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import tuwien.big.formel0.controller.GameControl;
import tuwien.big.formel0.entities.Player;
import twitter4j.Twitter;
import twitter4j.TwitterFactory;
import twitter4j.conf.ConfigurationBuilder;

/**
 *
 * @author Andra
 */
public class TwitterClient implements ITwitterClient {

    @Override
    public void publishUuid(TwitterStatusMessage message) throws Exception {
        ConfigurationBuilder cb = new ConfigurationBuilder()
            .setOAuthAccessToken("1366513208-MutXEbBMAVOwrbFmZtj1r4Ih2vcoHGHE2207002")
            .setOAuthAccessTokenSecret("RMPWOePlus3xtURWRVnv1TgrjTyK7Zk33evp4KKyA")
            .setOAuthConsumerKey("GZ6tiy1XyB9W0P4xEJudQ")
            .setOAuthConsumerSecret("gaJDlW0vf7en46JwHAOkZsTHvtAiZ3QUd2mD1x26J9w")
            .setDebugEnabled(true);
    
            TwitterFactory tf = new TwitterFactory(cb.build());
            Twitter twitter = tf.getInstance();
            
            String status = message.getTwitterPublicationString();
            twitter.updateStatus(status);
    }
    
}
